import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Chart from '../views/Chart.vue'
import Query from '../views/Query.vue'
import More from '../views/More.vue'
import About from '../views/About.vue'
import Search from '../views/Search.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import BarAndLineChart from '../components/BarAndLineChart.vue'


Vue.use(VueRouter)

const routes = [

  {
    path: '/login',
    name: 'Login',
    component: Login,
    meta: {
      title: '登录'
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
    meta: {
      title: '注册'
    }
  },
  {
    path: '',
    name: 'Index',
    component: Index,
  },
  {
    path: '/chart',
    name: 'Chart',
    component: Chart,
    meta: {
      title: '图表'
    }
  },
  {
    path: '/query',
    name: 'Query',
    component: Query,
    meta: {
      title: '查询'
    }
  },
  {
    path: '/more',
    name: 'More',
    component: More,
    meta: {
      title: '更多热搜'
    }
  },
  {
    path: '/about',
    name: 'About',
    component: About,
    meta: {
      title: '关于我'
    }
  },
  {
    path: '/search',
    name: 'Search',
    component: Search,
    meta: {
      title: '搜索'
    }
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
